import { ListPage } from "custom/index";
import { getInputPagePage } from './api'

import CheckPageTableBefore from './custom/CheckPageTableBefore'
import TableBefore from './component/InputTableBefore.vue'
const tableBefore = new CheckPageTableBefore('DataQueryHistoryTableBefore')
import dayjs from 'dayjs'
tableBefore.setComponent(TableBefore)

const page = new ListPage('DayPage');

page
  .api(getInputPagePage)
  .useSearch()
    .useInputItem('keyword', '录入人').showColumns(false).end()
    .useDateRangePicker(['dateStart', 'dateEnd'], { label: '日期', clearable: false }).setDefault(dayjs().subtract(2, 'day').format('YYYY-MM-DD'), 'dateStart').setDefault(dayjs().subtract(1, 'day').format('YYYY-MM-DD'), 'dateEnd').upto('PageSearch')
    .end()
  .useTable()
    .useIndexColumn().end()
    .useColumn('createUserName').label('录入人').minWidth(140).end()
    .useColumn('date').label('日期').minWidth(140).end()
    .useColumn('inputCount').label('录入量').minWidth(200).end()
    .end()
  .usePagination()
    .end()
  .addChild(tableBefore, 'table-before')

export default page
